import { createRouter, createWebHistory } from "vue-router";

const Login  = ()=>import("../components/Login.vue")
const routes = [
    { 
        path: '/', 
        redirect: '/login' 
    },
    {
        path:'/login',
        name:'login',
        component:Login,
    },
    {
        path: '/index',
        name: 'index',
        component: () => import("../components/Index.vue"),
        children:[
            {
                path:'/home',
                name: 'home',
                component:()=> import('../views/Home.vue')
            },
            {
                path:"/meeting",
                name:'meeting',
                component:()=>import('../views/Meeting.vue')
            },
            {
                path:"/user",
                name:'user',
                component:()=>import("../views/User.vue")
            },
            { 
                path: '/:pathMatch(.*)*',
                name: 'NotFound', 
                component: ()=>import("../views/404.vue")
            },
        ]
    },
]

const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

export default router;